package com.gamecauca.externalfactor;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.gamecauca.Assets;
import com.gamecauca.common.Constant;
import com.gamecauca.common.GameObject;

public class Cloud extends GameObject {
	private int kind; 
	public Cloud(){
		kindOfObject = Constant.CLOUD;
	}
	public Cloud(int iKind,int x,int y,int x_speed,int y_speed,int direct,int sideApp){
		kind = iKind;
		position.set(x, y);
		x_Speed = x_speed;
		y_Speed = y_speed;
		direction = direct;
		sideAppear = sideApp;
	}
	public void update(){
		if(sideAppear == Constant.LEFT){
			position.sub(x_Speed, y_Speed);
		}
		else if(sideAppear == Constant.RIGHT){
			position.add(x_Speed, y_Speed);
		}
	}
	
	public void render(SpriteBatch batch){
//		System.out.println("kind of Cloud :===================================="+kind);
		if(kind== Constant.BIGCLOUD){
			batch.draw(Assets.bigCloudRegion, position.x, position.y);
		}
		else if(kind== Constant.SMALLCLOUD){
			batch.draw(Assets.smallCloudRegion, position.x, position.y);
		}
		else if(kind== Constant.BLACKCLOUD){
			batch.draw(Assets.blackCloudRegion, position.x, position.y);
		}
		else if(kind== Constant.LIGHTING){
			batch.draw(Assets.lightingRegion, position.x, position.y);
		}
	}
	
	public void setKind(int ikind) {
		kind = ikind;
	}
	public int getKind() {
		return kind ;
	}
}
